<?php
    class entity_Ajax extends Ajax
    {
        public function getAllProductLayout()
        {
            if(isset($_POST['uri']))
            {
                echo '<input id="tb_uri" type="hidden" value="'.$_POST['uri'].'">';
            }
            $oDatabase = new database();
            $sQuery = "SELECT * FROM product_layout";
            $aLayouts = $oDatabase->getListObject($sQuery); 
            
            $aParams = array(
                'aProduct' => array(
                    'name' => 'NOKIA Lumia 920',
                    'price' => '23.450',
                    'description' => 'Cau hinh manh, ram 4GB, toc do 3mhz,bao hanh 2 nam, day du phu kien',
                    'uri' => '',
                    'ownUser' => 'Nguyen Loc',
                    'image' => '5.jpg',
                ),                
            );
            echo '<div class="product_layout_swap">';
            foreach($aLayouts as $aLayout)
            {
                $aParams['title'] = $aLayout->layout_name;
                includeBlock('entity/'.$aLayout->layout_name.'ProductEntity',$aParams);
            }
            echo '</div>';
        }
    }
?>
